package com.ruoyi.teach.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.teach.mapper.NbCourseMapper;
import com.ruoyi.teach.domain.NbCourse;
import com.ruoyi.teach.service.INbCourseService;

/**
 * 课程Service业务层处理
 * 
 * @author ruoyi
 * @date 2021-12-08
 */
@Service
public class NbCourseServiceImpl implements INbCourseService 
{
    @Autowired
    private NbCourseMapper nbCourseMapper;

    /**
     * 查询课程
     * 
     * @param id 课程主键
     * @return 课程
     */
    @Override
    public NbCourse selectNbCourseById(Long id)
    {
        return nbCourseMapper.selectNbCourseById(id);
    }

    /**
     * 查询课程列表
     * 
     * @param nbCourse 课程
     * @return 课程
     */
    @Override
    public List<NbCourse> selectNbCourseList(NbCourse nbCourse)
    {
        return nbCourseMapper.selectNbCourseList(nbCourse);
    }

    /**
     * 新增课程
     * 
     * @param nbCourse 课程
     * @return 结果
     */
    @Override
    public int insertNbCourse(NbCourse nbCourse)
    {
        nbCourse.setCreateTime(DateUtils.getNowDate());
        return nbCourseMapper.insertNbCourse(nbCourse);
    }

    /**
     * 修改课程
     * 
     * @param nbCourse 课程
     * @return 结果
     */
    @Override
    public int updateNbCourse(NbCourse nbCourse)
    {
        nbCourse.setUpdateTime(DateUtils.getNowDate());
        return nbCourseMapper.updateNbCourse(nbCourse);
    }

    /**
     * 批量删除课程
     * 
     * @param ids 需要删除的课程主键
     * @return 结果
     */
    @Override
    public int deleteNbCourseByIds(Long[] ids)
    {
        return nbCourseMapper.deleteNbCourseByIds(ids);
    }

    /**
     * 删除课程信息
     * 
     * @param id 课程主键
     * @return 结果
     */
    @Override
    public int deleteNbCourseById(Long id)
    {
        return nbCourseMapper.deleteNbCourseById(id);
    }
}
